package com.hsgene.order.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.result.PeanutApiResult;
import com.hsgene.order.service.api.impl.AgencyApplyOrderServiceImpl;
import com.hsgene.supplier.domain.GeneticTestingAgency;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 检测申请单
 *
 * @author wxf
 * @date 2018/9/21 15:13
 **/
@FeignClient(name = "ms-mod-supplier", path = "/v1.0/genetic/testing/agency", fallback = AgencyApplyOrderServiceImpl.class)
public interface AgencyApplyOrderService {

    /**
     * 申请单
     *
     * @param orderId   检测单ID
     * @param agencyIds 机构ID(多个用英文逗号隔开)
     * @return
     */
    @PostMapping
    PeanutApiResult addApplyOrder(@RequestParam("orderId") String orderId, @RequestParam(name = "agencyIds", required = false) String agencyIds);

    /***
     * 批量查询机构信息
     * @author jcl
     * @date 2018/11/13 14:29
     * @param ids
     * @return
     */
    @GetMapping("/ids")
    ApiResult<List<GeneticTestingAgency>> getAgencyByIds(@RequestParam("ids") String ids);
}
